<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>

<c:set var="defaultOperate" value="${moduleBody.defaultOperate}"/>
<%-- 操作-查找数据 --%>
<div com="myDataFind" myFilter="$`.currentFilter" 
 waitBar="$" run="bind" access="${defaultOperate.url}" class="${defaultOperate.operateId}"
 bindTargets='$`.js_filterButtonClick $`.js_filterButtonChange $`.js_orderButton $`.js_refresh <c:forEach items="${moduleBody.moduleFeature.cascadeFreshTargets}" var="cascadeFreshTarget">.${cascadeFreshTarget.operateId} </c:forEach>' 
 bindEvents='click change click click <c:forEach items="${moduleBody.moduleFeature.cascadeFreshTargets}">wait </c:forEach>'
 bindBeforeAction="@fun:baseFilterStart()" bindAfterAction="@fun:function_myDataFind()"
>

	<%-- S 过滤条件 --%>
	<%-- S 普通过滤 --%>
	<c:set var="baseFindFilterInfos" value="${moduleBody.baseFindFilterInfos}"/>
	<c:if test="${!empty baseFindFilterInfos}">
	<div com="myFilter" class="baseFilter currentFilter xxh_module_screen" style="padding-top: 10px;" >
		<c:forEach items="${baseFindFilterInfos}" var="filterInfo" >
			<%@ include file="filter/admin_common_filter_row1.jsp" %>
			<%@ include file="filter/admin_common_filter_row2.jsp" %>
		  	<%@ include file="filter/admin_common_filter_row3.jsp" %>
		</c:forEach>
	</div>
	</c:if>
	<%-- E 普通过滤 --%>
	
	<%-- S 分页条件 --%>
	<c:if test="${moduleType=='Page'}"><c:set var="pageFilterInfo" value="${moduleBody.pageFilterInfo}"/></c:if>
	<c:if test="${null != pageFilterInfo}">
	<div com="myFilter" class="basePageFilter currentFilter col-md-2 col-sm-4">
		<select name="${pageFilterInfo.pageSizeName}" class="form-control input-sm js_filterButtonChange" >
		    <option value="10">每页10条数据</option>
		    <option value="20">每页20条数据</option>
		    <option value="50">每页50条数据</option>
		    <option value="100">每页100条数据</option>
		</select>
	</div>
	</c:if>
	<%-- E 分页条件 --%>
	
	<%-- S 高级过滤 --%>
	<c:set var="advancedFindFilterInfos" value="${moduleBody.advancedFindFilterInfos}"/>
	<c:if test="${!empty advancedFindFilterInfos}">
	<div class="col-md-2">
        <button type="button" class="btn btn-primary" data-target="#myModal" onclick="advancedFilterStart(this)" >
        <span class="glyphicon glyphicon-open" ></span> 高级查询
        </button>
    </div>
    <form com="myFilter" class="advancedFilter">
	<%@ include file="filter/admin_common_filter_advanced.jsp" %>
	</form>
	</c:if>
	<%-- E 高级过滤 --%>
	<%-- E 过滤条件 --%>
	
	<br/>
	
	<%-- S 表 --%>
	<div class="xxh_module_table" >

		<%-- S 统计 --%>
		<c:if test="${moduleType=='Page'}">
			<br/>
			<div class="message js_pageInfoPostion" > </div>
			<script type="text/x-jquery-tmpl" property="page" com="myScript" appendTo="$$`.js_pageInfoPostion" bindTargets="$$myDataFind">
				{{if #data}}
					<a>共{{:fullResult}}条数据 共{{:fullPage}}页</a>
				{{/if}}
				</script>
		</c:if>
		<%-- E 统计 --%>
		
		<!-- S table -->
		<c:set var="outputInfos" value="${moduleBody.outputInfos}"/>
		<%-- 功能-全选 --%>
		<div com="myCheckBox" >
		<%-- 操作-myWebsocket --%>
		<%-- <div com="myWebsocket" sendAfterAction="@fun:fun_popup_process()" receiveAfterAction="@fun:fun_popup_process_receive()"> --%>
		<%-- 操作-数据提交(iframe表单方式)-表头多个 --%>
		<div com="myDataSubmits" bindTargets="$$.js_module`.js_dataSubmits_head" bindEvents="click" myFilter="$$myDataFind`.currentFilter" waitBar="window" 
		 bindBeforeAction="@fun:fun_popup_confirm('确认提交?')" bindAfterAction="@fun:fun_popup_message('')"
		>
		<%-- 操作-数据提交(ajax方式)-表项单个 --%>
		<div com="myDataSubmit" bindTargets="$$.js_module_body`.js_dataSubmit_body" bindEvents="click" waitBar="window" 
		 bindBeforeAction="@fun:fun_popup_confirm('确认操作?')" bindAfterAction="@fun:fun_popup_message('')"
		>
		<%-- 操作-导出文件-表头多个 --%>
		<div com="myDataSubmits" bindTargets="$$.js_module`.js_dataExcelExport_head" bindEvents="click" myFilter="$$myDataFind`.currentFilter" 
		 bindBeforeAction="@fun:fun_popup_confirm('确认导出文件?')" bindAfterAction="@fun:fun_popup_message('')"
		>
		<%-- 操作-导出文件-表项单个 --%>
		<div com="myA" bindTargets="$$.js_module_body`.js_dataExcelExport_body" bindEvents="click"
		 bindBeforeAction="@fun:fun_popup_confirm('确认导出文件?')" bindAfterAction="@fun:fun_popup_message('')"
 		>
 		<%-- 操作-删除-表头多个 --%>
 		<div com="myDataDeletes" bindTargets="$$.js_module`.js_dataDeletes_head" bindEvents="click" waitBar="window" 
 		 bindBeforeAction="@fun:fun_popup_confirm('确认删除?')" bindAfterAction="@fun:fun_popup_message('')" 
		 defaultConfirmMessage="false" defaultSuccessMessage="false"
		>
 		<%-- 操作-删除-表项单个 --%>
 		<div com="myDataDelete" bindTargets="$$.js_module_body`.js_dataDelete_body" bindEvents="click" 
		 waitBar="window" bindBeforeAction="@fun:fun_popup_confirm('确认删除?')" bindAfterAction="@fun:fun_popup_message('')"
		 defaultConfirmMessage="false" defaultSuccessMessage="false"
 		>
 		<%-- 操作-表单提交 --%>
		<div com="myForm" bindTargets="$$.js_module`.js_myForm" bindEvents="click" myFilter="$$myDataFind`.currentFilter" style="overflow-x: auto; width:100%;" >
		<!-- S 表 -->
		<table class="table table-striped table-hover" >
			<thead>
				<tr class="js_head_tr">
					<c:if test="${!empty moduleBody.identifier}" >
					<th width="60"><input com-fire="myCheckBox" type="checkbox"/>选择</th>
					</c:if>
					<c:forEach items="${outputInfos}" var="outputInfo">
						<c:if test="${!outputInfo.enableOrder}">
							<th <c:if test="${outputInfo.display=='Hide'}">style='display:none;'</c:if> > 
								${outputInfo.comment}
							</th>
						</c:if>
							<c:if test="${outputInfo.enableOrder}">
						<th <c:if test="${outputInfo.display=='Hide'}">style='display:none;'</c:if> class="js_orderButton js_orderButton_${outputInfo.name}" onclick="js_order(this)" orderby="${outputInfo.name}">
							${outputInfo.comment}
							<button class="btn btn-default btn-xs" aria-label="Left Align" style="outline:none;box-shadow:none;">
								<span class=" glyphicon glyphicon-sort js_sorting" aria-hidden="true"></span>
							</button>
						</th>
						</c:if>
					</c:forEach>
					<th>操作</th>
				</tr>
			</thead>
			<tbody>
			
			</tbody>
		</table>
		<!-- E 表 -->
		</div>
		</div>
		</div>
		</div>
		</div>
		</div>
		</div>
		</div>
		<!-- E table -->

 		<%-- S 表数据 --%>
 		<script>
			function myDataFind_myScript_bindAfterAction(){
				$('.tooltips').tooltip()
				// 重新计算iframe高度
				obtainOwnerIframe().each(function(){
					showIframeAllHeight(this);
				})
			}
		</script>
		
		<script com="myScript" type="text/template" appendTo="$$`tbody" bindAfterAction="@fun:myDataFind_myScript_bindAfterAction()">
		{{if #data.records.length == 0}}
			<tr><td colspan="${fn:length(outputInfos)}" >没与数据</td></tr>
		{{else}}
			{{for records}}
			<tr {{if _style}}style="{{:_style}}"{{/if}} >
				<c:if test="${!empty moduleBody.identifier}" >
				<td>
					<input type="checkbox" onchange="function_checkbox(this)" />
					<input style="display:none;" type="checkbox" name="${moduleBody.identifier}[]" value="{{:${moduleBody.identifier}}}" />
				</td>
				</c:if>
				<c:forEach items="${outputInfos}" var="outputInfo">
					<td <c:if test="${outputInfo.display=='Hide'}">style='display:none;'</c:if> >
					<c:if test='${outputInfo.dataType!="Img"}'>
						{{if ${outputInfo.name}===true}}
							<span style="color:green">是</span>
						{{else ${outputInfo.name}===false}}
							<span style="color:red">否</span>
						{{else}}
							{{:${outputInfo.name}}}
						{{/if}}
					</c:if>
					<c:if test='${outputInfo.dataType=="Img"}'>
						<img onclick="fun_showBigImg(this)" width="50" height="50" src="{{:${outputInfo.name}}}" />
					</c:if>
					</td>
				</c:forEach>
				<td>
					<c:set var="operates" value="${moduleBody.listOperates}"/>
					<%@include file="common/admin_common_operate_page.jsp" %>
	 			</td> 
			</tr>
			{{/for}}
		{{/if}}
		</script>
		
		<%-- S 排序数据 --%>
		<c:set var="orderFilterInfo" value="${moduleBody.orderFilterInfo}"/>
		<c:if test="${null != orderFilterInfo}">
			<script type="text/x-jquery-tmpl" com="myScript" bindAfterAction="@fun:js_orderScript()"></script>
			<div com="myFilter" class="orderFilter currentFilter" style="display: none;">
			    <input class="js_orderWay" name="${orderFilterInfo.orderWayName}" value="${orderFilterInfo.defaultOrderWay}"/>
			    <input class="js_orderBy" name="${orderFilterInfo.orderByName}" value="${orderFilterInfo.defaultOrderBy}"/>
			</div>
		</c:if>
		<%-- E 排序数据 --%>
		
		<%-- 分页 --%>
		<c:if test="${moduleType=='Page'}">
			<jsp:include page="/WEB-INF/templates/jspTemplates/jspTemplates_mySeparatePage_2.jsp" />
 		</c:if>
	</div>
	<%-- E 表 --%>
</div>